package com.mall.project.gs.model.parm;

import com.mall.common.core.model.supers.Convert;
import com.mall.common.security.annotation.EnumValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author Sam
 * @since 2021-10-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "GoodsSpuPARM对象", description = "商品表")
public class GoodsSpuPARM extends Convert {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "PK")
    private String id;

    @ApiModelProperty(value = "spu编码")
    private String spuCode;

    @ApiModelProperty(value = "spu名字")
    private String name;

    @ApiModelProperty(value = "卖点")
    private String sellPoint;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "一级分类ID")
    private String categoryFirst;

    @ApiModelProperty(value = "二级分类ID")
    private String categorySecond;

    @ApiModelProperty(value = "商品图片")
    private String picUrls;

    @ApiModelProperty(value = "是否上架（1是 0否）")
    @EnumValue(intValues = {0, 1}, groups = {ChangeShelf.class}, message = "状态不能为空/必须为指定值")
    private Integer shelf;

    @ApiModelProperty(value = "排序字段")
    private Integer sort;

    @ApiModelProperty(value = "销售价格")
    private BigDecimal salesPrice;

    @ApiModelProperty(value = "市场价")
    private BigDecimal marketPrice;

    @ApiModelProperty(value = "成本价")
    private BigDecimal costPrice;

    @ApiModelProperty(value = "库存")
    private Integer stock;

    @ApiModelProperty(value = "销量")
    private Integer saleNum;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "最后更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除标记（0：显示；1：隐藏）")
    private Integer delFlag;

    /**
     * 表外字段
     */

    @ApiModelProperty(value = "id数组")
    @NotEmpty(groups = {ChangeShelf.class}, message = "id数组不能为空")
    private List<String> idList;

    public interface Create {

    }

    public interface ChangeShelf {

    }


}
